- /* sdmmlp10.cpp by K.Tsuru */
- // function ID = 341 DRADIX
- /*******************************************
- SDouble class
- a member function
- It multiplies by the 10 to the p-th power.
- *this *= 10^p
- *******************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- static const char* const func = "MultPow10";
- SDouble& SDouble::MultPow10(long p){
- if(Type() != REAL) SetError(RADIX_ERR, func, 341);
- if(!p || (Sign(341) == 0) ) return *this;
- long n = p/DFIGURES, r = p - DFIGURES*n;// p < 0 is ok
- if(r < 0){
- r += DFIGURES; n--;
- }
- if(labs(n) > DRADIX_EXP_MAX) SetError(TOO_LARGE_EXP, func, 341);
- if(n) MultPowRdx((int)n); // includes Reform();
- //Maybe in the fixed point mode and n<0 it becomes zero.
- if(r && Sign(341)){
- ulong c = (ulong)ipow10((int)r);
- *this = DsMult(*this, c); // includes Reform();
- }
- return *this;
- }
sdmmlp10.cpp : last modifiled at 2015/11/25 20:15:20(877 bytes)
created at 2017/10/07 10:21:15
The creation time of this html file is 2017/10/07 10:30:03 (Sat Oct 07 10:30:03 2017).